<template>
    <div class="content">
        <van-nav-bar title="设置" left-text="返回" left-arrow @click-left="onClickLeft" />
        <div class="top">
            <van-cell-group inset>
                <van-cell title="个人信息" icon="shield-o" is-link to="/personal" />
                <van-cell title="关于我们" icon="setting-o" is-link to="/about" />
            </van-cell-group>
        </div>
        <div class="btn">
            <van-button type="primary" block @click="quit">退出登录</van-button>
        </div>
    </div>
</template>
  
<script lang="ts" setup>
const onClickLeft = () => history.back();
const userInfoCookie = useCookie('userInfo')
const shopcodeCookie=useCookie('shopcode')
const myshopcodeCookie = useCookie('myshopcode')
const isShop=useUserStateIsShop()
const quit = () => {
    userInfoCookie.value = ""
    shopcodeCookie.value=""
    myshopcodeCookie.value=""
    isShop.value=''
    setTimeout(() => {
        goto()
    }, 1000);
}
const router = useRouter();
function goto() {
    router.push('/user')
}
</script>
  
<style scoped lang="scss">
.content {
    height: 100vh;
    background-color: rgb(240, 236, 236);

    .top {
        width: 90vw;
        position: relative;
        top: 0.6rem;
        margin: 0 auto;
        font-size: 1rem;
    }

    .btn {
        position: relative;
        top: 2rem;
        width: 82vw;
        margin: 0 auto;
    }
}
</style>